home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / ShareMailGiftware / Frogger / plugins_src / p_ac3 / decode.c < prev    next >
C/C++ Source or Header  |  2002-10-28  |  826b  |  42 lines

  1.  
  2. #include "ac3.h"
  3. #include "decoder.h"
  4. #include "compiler.h"
  5.  
  6. static SAMPLE s;
  7.  
  8. ASMFUNC(void *)InitA(REG(d0, int, freq), REG(d1, int, channels), REG(d2, int, bits), REG(a0, void , *dummy))
  9. {
  10.     void *ac3_handle = initAC3();
  11.     return ac3_handle;
  12. }
  13.  
  14. ASMFUNC(void) CloseA(REG(a0, void ,*handle))
  15. {
  16.     if(handle) closeAC3(handle);
  17. }
  18.  
  19. ASMFUNC(void) OptionsA(REG(a0, void, *handle), REG(d0, int, option), REG(d1, int, value))
  20. {
  21. }
  22.  
  23. ASMFUNC(void *)DecodeA(REG(a0, void, *handle), REG(a1, void, *data), REG(a2, void, *out), REG(d0, int, size))
  24. {
  25.     int osize = 0;
  26.     int ac3_freq;
  27.  
  28.     decodeAC3(handle, data, ((char *)data) + size, out, &osize, &ac3_freq);
  29.  
  30.     s.outsize = osize;
  31.     s.frequency = ac3_freq;
  32.     s.channels = 2;
  33.     s.bits = 16;
  34.     return &s;
  35. }
  36.  
  37. ASMFUNC(void) VersionA(REG(d0, int, *major), REG(d1, int, *minor))
  38. {
  39.     *major = 1;
  40.     *minor = 0;
  41. }
  42.